/*
 * ShoppingCartContract.java
 * business
 *
 * Created by ChenTao on 2016/9/9.
 *
 * Copyright (c) 2016年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.main.shoppingcart;

import com.yidiandao.business.base.BasePresenter;
import com.yidiandao.business.base.BaseView;
import com.yidiandao.business.data.bean.Goods;
import com.yidiandao.business.data.event.RefreshShoppingCartEvent;
import com.yidiandao.business.data.imagemodule.ImageAD;
import com.yidiandao.business.data.imagemodule.Notice;
import com.yidiandao.business.interfaces.RefreshLayoutStateListener;
import com.yidiandao.business.ui.widget.listview.DisplayListItem;

import java.util.List;

/**
 * 购物车-契约类
 *
 * <p>Created by ChenTao(chentao7v@gmail.com) on 2017/2/8 15:44
 */
public class ShoppingCartContract {

    interface Presenter extends BasePresenter {

        void loadServerShoppingCartList();

        void showOrHidePayMenu();

        /** 下拉刷新时将购物车列表所有状态初始化 */
        void initPayMenu();

        void changeShoppingCartMode(boolean isEditMode);

        /** 删除购物车选中的商品 */
        void delete();

        void loadRecommendGoodsList();

        /** 检查是否有选中商品 */
        void checkHasSelectedGoodsToDelete();

        /** 检查商品库存并结算 */
        void checkStockAndBalance();

        /** 如果用户已在其他设备登录，切换到购物车时 */
        boolean checkLogin();

        /** 通知选择的赠品发生变化 */
        void notifyShoppingCartStatisticsChanged();

        /** 通过单个商品加载当前商品所属店铺的订单信息 */
        void loadCartListByWhenGoodsCountChanged(Goods goods);

        void postShoppingCartData();
    }

    interface View extends BaseView<Presenter>, RefreshLayoutStateListener {

        void setRefreshComplete();

        void setRecommendGoodsList(List<Goods> goodsList);

        void setDisplayListItems(List<DisplayListItem> displayListItems);

        void onEventMainThread(RefreshShoppingCartEvent event);

        void setSelectAllCheckBoxState(boolean checked);

        void notifyAdapterDataSetChanged();

        void showLoadingDialog();

        void dismissLoadingDialog();

        void setPayButtonEnable(boolean enable);

        void switchHomeFragment();

        void selectOrCancelAllToPay();

        void showDeleteGoodsHintDialog();

        void toConfirmOrderActivity();

        void showOrHidePayMenuAndClearSelected(boolean showPayMenu);

        void showOrHidePayMenu(boolean showPayMenu);

        void setTopRightVisibility(boolean visibility);

        void showStockNotEnoughOrPriceChangedDialog(String message);

        void setRecommendGoodsAdvert(ImageAD advert);

        void setNoticeInfo(List<Notice> noticeList);
    }
}
